/**
 * @author Guoxing.Han(hancoson#163.com)
 * @time 2016/12/29.
 */
var path = require("path");
var webpack = require('webpack');
var ExtractTextPlugins = require('extract-text-webpack-plugin');

module.exports = {
    entry: {
        main: [
            './app/app.js',
            'webpack-dev-server/client?http://localhost:8888',
            'webpack/hot/only-dev-server'
        ]
    },
    output: {
        publicPath: 'http://localhost:8888/',
        filename: './dist/js/bundle.js'
        /*path      : path.resolve(__dirname, 'dist'),
         publicPath: "./dist/js/",
         filename  : "bundles.js"*/
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loaders: ['react-hot-loader', 'babel-loader?' + JSON.stringify({presets: ['react', 'es2015']})]
            },
            {
                test: /\.scss/,
                loader: 'style-loader!css-loader!sass-loader'
            },
            {
                test: /\.(png|jpg|gif)$/,
                loader: 'url-loader?limit=2000'
            }
        ]
    },
    plugins: [
        new ExtractTextPlugins({
            filename: './dist/style/main.css',
            allChunks: true
        })
    ],
    resolve: {
        extensions: ['.js', '.es6']
    },
    devServer: {
        inline: true
        /*host: '0.0.0.0',
         proxy: [{
         //path: '/admin/!*',
         // target: 'http://10.2.82.209:8899' //开发1
         }]*/
    }
};
